#include "block.h"

CBlock::CBlock():m_live(1)
{

}

void CBlock::setDec(int live)
{
    m_live -= live;
}

int CBlock::getLive()
{
    return m_live;
}

void CBlock::paint(QPainter *painter)
{
    if(m_live > 0 ){
        painter->setBrush(Qt::green);
        painter->drawRect(
                        static_cast<int>(getX()),
                        static_cast<int>(getY()),
                        static_cast<int>(getWidth()),
                        static_cast<int>(getHeght()));
    }

}
